﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Script.UI.Component
{

    public class DoubleSlider : HistogramDisplay
    {
        public Slider Sld_Histogram1;
        public Slider Sld_Histogram2;

        public override void Display()
        {
            float fPercent = 0;
            float fDifferenceValue = MaxValue - MinValue * 0.9f;
            if (fDifferenceValue - 0f < 0.00000001)
            {
                fPercent = 0;
            }
            else
            {
                fPercent = (CurrentValue - MinValue * 0.9f) / fDifferenceValue;
            }

            if (Sld_Histogram1 != null)
            {
                Sld_Histogram1.value = fPercent;
            }
            if (Sld_Histogram2 != null)
            {
                Sld_Histogram2.value = 1 - fPercent;
            }
        }
    }


}
